<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Events - Vue Lesson 4</title>
    <script src="bower_components/vue/dist/vue.min.js"></script>
</head>

<body>
<!-- 访问原生DOM-->
<div id="demo1">
    <button v-on:click="warn('Form cannot be submitted yet.', $event)">Submit</button>
</div>

<script type="text/javascript">
    var demo1 = new Vue({
        el: '#demo1',
        data: {

        },
        methods: {
            warn: function (message, event) {
                // 现在我们可以访问原生事件对象
                if (event) event.preventDefault()
                alert(message)
            }
        }
    });

</script>
<!--／END 访问原生DOM-->


</body>
</html>